<template>
  <div>
    <div class="popWin" :style="{ zIndex: zIndex }" v-if="show">
      <div class="popWinBg"></div>
      <div class="popWinMain" ref="popWinMain" :style="{height:this.height}">
        <bg></bg>
        <!--<div class="popClose" ref="popClose" v-if="showInner" @click="getHide"></div>-->
        <div class="popWinMainInner" v-if="showInner">
          <div class="tables" @scroll="handleScroll">
            <div class="slot">
              <p class="titleName" style="font-size:20px;font-weight:bold;margin-top: 0">个人KPI</p>
              <table class="horizontal-table noneBorder">
                <tr>
                  <th class="tb12">完成比例</th>
                  <td class="tb12" colspan="3">{{ (personKpiDetail.percentage*100).toFixed(2) + '%' }}</td>
                  <th class="tb12">目标金额</th>
                  <td class="tb12">{{ personKpiDetail.targetAmount }}</td>
                </tr>
                <tr>
                  <th class="tb12">单位</th>
                  <td class="tb12">{{ personKpiDetail.unit }}</td>
                  <th class="tb12">id</th>
                  <td class="tb12">{{ personKpiDetail.id }}</td>
                  <th class="tb12">姓名</th>
                  <td class="tb12">{{ personKpiDetail.name }}</td>
                </tr>
                <tr>
                  <th class="tb12">合同编号</th>
                  <td class="tb12">{{ personKpiDetail.contractNumber }}</td>
                  <th class="tb12">单店合同号</th>
                  <td class="tb12">{{ personKpiDetail.contractNumber }}</td>
                  <th class="tb12">合同名称</th>
                  <td class="tb12">{{ personKpiDetail.contractName }}</td>
                </tr>
                <tr>
                  <th class="tb12">合同签订金额</th>
                  <td class="tb12" colspan="3">{{ personKpiDetail.contractSignAmount }}</td>
                  <th class="tb12">框架合同金额</th>
                  <td class="tb12">{{ personKpiDetail.frameworkContractAmount }}</td>
                </tr>
              </table>
            </div>
          </div>
          <!--<div class="tables" @scroll="handleScroll">
            &lt;!&ndash;项目综合成本统计&ndash;&gt;
            <div class="slot">
              <p class="titleName" style="font-size:20px;font-weight:bold;margin-top: 0">项目综合成本统计</p>
              <table class="horizontal-table noneBorder">
                <tr>
                  <th class="tb12">项目名称</th>
                  <td class="tb12" colspan="3">{{ form1.projectName }}</td>
                  <th class="tb12">单店名称</th>
                  <td class="tb12">{{ form1.storeName }}</td>
                </tr>
                <tr>
                  <th class="tb12">项目编号</th>
                  <td class="tb12">{{ form1.projectNumber }}</td>
                  <th class="tb12">项目负责人</th>
                  <td class="tb12">{{ form1.projectLeader }}</td>
                  <th class="tb12">项目甲方</th>
                  <td class="tb12">{{ form1.projectClient }}</td>
                </tr>
                <tr>
                  <th class="tb12">合同编号</th>
                  <td class="tb12">{{ form1.contractNumber }}</td>
                  <th class="tb12">单店合同号</th>
                  <td class="tb12">{{ form1.contractNumber }}</td>
                  <th class="tb12">合同名称</th>
                  <td class="tb12">{{ form1.contractName }}</td>
                </tr>
                <tr>
                  <th class="tb12">合同签订金额</th>
                  <td class="tb12" colspan="3">{{ form1.contractSignAmount }}</td>
                  <th class="tb12">框架合同金额</th>
                  <td class="tb12">{{ form1.frameworkContractAmount }}</td>
                </tr>
                <tr>
                  <th class="tb12">合同增补金额</th>
                  <td class="tb12" colspan="3">{{ form1.contractSupplementAmount }}</td>
                  <th class="tb12">合同执行金额</th>
                  <td class="tb12">{{ form1.contractExecAmount }}</td>
                </tr>
                <tr>
                  <th class="tb12">合同未收款</th>
                  <td class="tb12" colspan="3">{{ form1.contractUncollected }}</td>
                  <th class="tb12">合同收款占比</th>
                  <td class="tb12">{{ (form1.contractCollectionRatio*100).toFixed(2)+'%' }}</td>
                </tr>
                <tr>
                  <th class="tb12">合同未开票</th>
                  <td class="tb12" colspan="3">{{ form1.contractUninvoiced }}</td>
                  <th class="tb12">合同开票占比</th>
                  <td class="tb12">{{ (form1.contractInvoicingRatio*100).toFixed(2)+'%' }}</td>
                </tr>
              </table>
            </div>
            &lt;!&ndash;项目对应采购合同明细&ndash;&gt;
            <div class="slot" :style="{height: contract.length>1?'320px':''}">
              <p class="titleName">项目对应采购合同明细</p>
              <el-table :data="contract" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="合同编号" show-overflow-tooltip align="center" prop="purchaseContractNumber">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.purchaseContractNumber }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="合同名称" show-overflow-tooltip prop="contractName" align="center">
                </el-table-column>
                <el-table-column label="合同乙方" show-overflow-tooltip prop="supplier" align="center">
                </el-table-column>
                <el-table-column label="合同金额" prop="contractAmount" align="center">
                </el-table-column>
                &lt;!&ndash;<el-table-column label="运费金额" show-overflow-tooltip prop="projectName" align="center"></el-table-column>&ndash;&gt;
                <el-table-column label="项目采购金额" prop="projectAmount" align="center">
                </el-table-column>
                <el-table-column label="项目销售金额" prop="salesAmount" align="center">
                </el-table-column>
                <el-table-column label="利润率" prop="profitMargin" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ (scope.row.profitMargin*100).toFixed(2)+'%' }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="已付金额" prop="paidAmount" align="center">
                </el-table-column>
                &lt;!&ndash;<el-table-column label="应付金额" show-overflow-tooltip prop="projectName" align="center"></el-table-column>&ndash;&gt;
                <el-table-column label="已收票额" prop="invoiceReceived" align="center">
                </el-table-column>
                &lt;!&ndash;<el-table-column label="应收票额" show-overflow-tooltip prop="projectName" align="center"></el-table-column>&ndash;&gt;
                <el-table-column label="负责人" prop="purchaseOwner" align="center">
                </el-table-column>
              </el-table>
              &lt;!&ndash;合计金额&ndash;&gt;
              <table class="horizontal-table">
                <tr>
                  <th class="tb12">合计采购金额</th>
                  <td class="tb12">{{ form1.totalPurchaseAmount }}</td>
                  <th class="tb12">对应销售金额</th>
                  <td class="tb12">{{ form1.correspondingSalesAmount }}</td>
                  <th class="tb12">合计已付金额</th>
                  <td class="tb12">{{ form1.totalPaidAmount }}</td>
                  <th class="tb12">合计应付金额</th>
                  <td class="tb12">{{ form1.totalPayableAmount }}</td>
                </tr>
                <tr>
                  <th class="tb12">合计已收票额</th>
                  <td class="tb12">{{ form1.totalReceivedInvoice }}</td>
                  <th class="tb12">应收票额合计</th>
                  <td class="tb12">{{ form1.totalReceivableInvoice }}</td>
                  <th class="tb12">已付未收票额</th>
                  <td class="tb12">{{ form1.paidUnreceivedInvoice }}</td>
                  <th class="tb12">采购利润率</th>
                  <td class="tb12">{{ form1.purchaseProfitMargin=='-'?'0.00%':(form1.purchaseProfitMargin*100).toFixed(2)+'%' }}</td>
                </tr>
              </table>
            </div>
            &lt;!&ndash;项目非合同支付明细&ndash;&gt;
            <div class="slot" :style="{height: payment.length>1?'260px':''}">
              <p class="titleName">项目非合同支付明细</p>
              <el-table :data="payment" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="付款申请单号" align="center" prop="paymentNo">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.paymentNo }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="付款类别" show-overflow-tooltip prop="paymentType" align="center">
                </el-table-column>
                <el-table-column label="付款金额" prop="amount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.amount }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="费用说明" show-overflow-tooltip prop="expenseDescription" align="center">
                </el-table-column>
                <el-table-column label="支付备注" show-overflow-tooltip prop="paymentRemark" align="center">
                </el-table-column>
                <el-table-column label="申请日期" show-overflow-tooltip prop="applyDate" align="center">
                </el-table-column>
                <el-table-column label="支付日期" show-overflow-tooltip prop="paymentDate" align="center">
                </el-table-column>
              </el-table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb50">项目非合同支付合计</th>
                  <td class="tb50">{{ form1.nonContractPaymentTotal }}</td>
                </tr>
              </table>
            </div>
            &lt;!&ndash;报销明细&ndash;&gt;
            <div class="slot" :style="{height: reimbursements.length>1?'260px':''}">
              <p class="titleName">报销明细</p>
              <el-table :data="reimbursements" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="报销单号" align="center" prop="reimbursementNo">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.reimbursementNo }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="报销时间" show-overflow-tooltip prop="reimburseTime" align="center">
                </el-table-column>
                <el-table-column label="报销人" prop="applicant" align="center">
                </el-table-column>
                <el-table-column label="报销科目" show-overflow-tooltip prop="subject" align="center">
                </el-table-column>
                <el-table-column label="报销说明" show-overflow-tooltip prop="description" align="center">
                </el-table-column>
                <el-table-column label="报销金额" show-overflow-tooltip prop="amount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.amount }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="所属部门" show-overflow-tooltip prop="department" align="center">
                </el-table-column>
              </el-table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb50">项目合计报销费用</th>
                  <td class="tb50">{{ form1.totalPurchaseAmount }}</td>
                </tr>
              </table>
            </div>
            &lt;!&ndash;工程费用明细&ndash;&gt;
            <div class="slot" :style="{height: expense.length>1?'260px':''}">
              <p class="titleName">工程费用明细</p>
              <p style="color:#fff;margin:0 10px 10px 10px;">一、安装费用明细</p>
              <el-table :data="costrecord" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="序号" align="center" type="index">
                </el-table-column>
                <el-table-column label="费用类型" show-overflow-tooltip prop="costType" align="center">
                </el-table-column>
                <el-table-column label="报销单号" prop="costId" align="center">
                </el-table-column>
                <el-table-column label="报销时间" show-overflow-tooltip prop="costTime" align="center">
                </el-table-column>
                <el-table-column label="报销人" show-overflow-tooltip prop="applicant" align="center">
                </el-table-column>
                <el-table-column label="费用说明" show-overflow-tooltip prop="costDescription" align="center">
                </el-table-column>
                <el-table-column label="金额" show-overflow-tooltip prop="amount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.amount }}</span>
                  </template>
                </el-table-column>
              </el-table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb50">安装费用合计</th>
                  <td class="tb50">{{ form1.installationCostTotal }}</td>
                </tr>
              </table>
              <p style="color:#fff;margin:10px;">二、外协人员工资明细</p>
              <el-table :data="expense" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="序号" align="center" type="index">
                </el-table-column>
                <el-table-column label="表单编号" show-overflow-tooltip prop="formNumber" align="center">
                </el-table-column>
                <el-table-column label="申请人" prop="applicant" align="center">
                </el-table-column>
                <el-table-column label="申请日期" show-overflow-tooltip prop="applyDate" align="center">
                </el-table-column>
                <el-table-column label="工资月份" show-overflow-tooltip prop="month" align="center">
                </el-table-column>
                <el-table-column label="金额" show-overflow-tooltip prop="amount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.amount }}</span>
                  </template>
                </el-table-column>
              </el-table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb50">外协人员工资合计</th>
                  <td class="tb50">{{ form1.outsourcingSalaryTotal }}</td>
                </tr>
              </table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb25">工程费用合计</th>
                  <td class="tb25">{{ form1.engineeringCostTotal }}</td>
                  <th class="tb25">工程费用占比</th>
                  <td class="tb25">{{ (form1.engineeringCostRatio*100).toFixed(2)+'%' }}</td>
                </tr>
              </table>
            </div>
            &lt;!&ndash;库存出货记录&ndash;&gt;
            &lt;!&ndash;<div class="slot" :style="{height: payment.length>1?'260px':''}">
              <p class="titleName">库存出货记录</p>
              <el-table :data="tableDataList.slice(0,1)" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="序号" align="center" type="index">
                </el-table-column>
                <el-table-column label="品名" show-overflow-tooltip prop="projectName" align="center">
                </el-table-column>
                <el-table-column label="品牌" prop="projectType" align="center">
                </el-table-column>
                <el-table-column label="型号" show-overflow-tooltip prop="projectName" align="center">
                </el-table-column>
                <el-table-column label="尺寸" show-overflow-tooltip prop="projectName" align="center">
                </el-table-column>
                <el-table-column label="出库" align="center">
                    <el-table-column prop="projectName" align="center" label="数量"></el-table-column>
                    <el-table-column prop="projectName" align="center" label="单价"></el-table-column>
                    <el-table-column prop="projectName" align="center" label="总价"></el-table-column>
                    <el-table-column prop="projectName" align="center" label="日期"></el-table-column>
                    <el-table-column prop="projectName" align="center" label="出库人"></el-table-column>
                </el-table-column>
                <el-table-column label="出库备注" show-overflow-tooltip prop="projectName" align="center">
                </el-table-column>
              </el-table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb25">合计出库数量</th>
                  <td class="tb25">{{ form1.totalPurchaseAmount }}</td>
                  <th class="tb25">合计出库成本</th>
                  <td class="tb25">{{ form1.totalPurchaseAmount }}</td>
                </tr>
              </table>
            </div>&ndash;&gt;
            &lt;!&ndash;保内售后成本-合同&ndash;&gt;
            <div class="slot" :style="{height: insurancecontract.length>1?'260px':''}">
              <p class="titleName">保内售后成本-合同</p>
              <el-table :data="insurancecontract" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="序号" align="center" type="index">
                </el-table-column>
                <el-table-column label="合同编号" show-overflow-tooltip prop="contractNumber" align="center">
                </el-table-column>
                <el-table-column label="合同名称" show-overflow-tooltip prop="contractName" align="center">
                </el-table-column>
                <el-table-column label="合同乙方" show-overflow-tooltip prop="supplier" align="center">
                </el-table-column>
                <el-table-column label="合同金额" show-overflow-tooltip prop="contractAmount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.contractAmount }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="负责人" show-overflow-tooltip prop="purchaseOwner" align="center">
                </el-table-column>
                <el-table-column label="项目成本金额" show-overflow-tooltip prop="projectCostAmount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.projectCostAmount }}</span>
                  </template>
                </el-table-column>
              </el-table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb50">合计售后成本金额</th>
                  <td class="tb50">{{ form1.totalAfterSalesCost }}</td>
                </tr>
              </table>
            </div>
            &lt;!&ndash;合同清单变更明细&ndash;&gt;
            <div class="slot" :style="{height: contractChange.length>1?'260px':''}">
              <p class="titleName">合同清单变更明细</p>
              <el-table :data="contractChange" height="100%" style="width: 100%" stripe @row-click="handleRowClick">
                <el-table-column label="序号" align="center" type="index">
                </el-table-column>
                <el-table-column label="合同变更编号" show-overflow-tooltip prop="contractChangeNo" align="center">
                </el-table-column>
                <el-table-column label="填报部门" prop="reportingDept" align="center">
                </el-table-column>
                <el-table-column label="填报人" show-overflow-tooltip prop="reporter" align="center">
                </el-table-column>
                <el-table-column label="变更发起方" show-overflow-tooltip prop="changeInitiator" align="center">
                </el-table-column>
                <el-table-column label="变更原因" show-overflow-tooltip prop="changeReason" align="center">
                </el-table-column>
                <el-table-column label="提交时间" show-overflow-tooltip prop="submissionDate" align="center">
                </el-table-column>
                <el-table-column label="销售金额合计" show-overflow-tooltip prop="totalSalesAmount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.totalSalesAmount }}</span>
                  </template>
                </el-table-column>
              </el-table>
              <table class="horizontal-table">
                <tr>
                  <th class="tb50">合计合同清单变更金额</th>
                  <td class="tb50">{{ form1.changeSalesTotal }}</td>
                </tr>
              </table>
            </div>
            &lt;!&ndash;项目收款明细&ndash;&gt;
            <div class="slot" :style="{height: bankAccounts.length>1?'200px':''}">
              <p class="titleName">项目收款明细</p>
              <el-table :data="bankAccounts" height="100%" style="width: 100%;border-bottom: 1px solid rgba(163,186,239,0.2)" stripe @row-click="handleRowClick">
                <el-table-column label="序号" align="center" type="index">
                </el-table-column>
                <el-table-column label="入账银行" show-overflow-tooltip prop="bankName" align="center">
                </el-table-column>
                <el-table-column label="银行账号" show-overflow-tooltip prop="bankAccount" align="center">
                </el-table-column>
                <el-table-column label="入账金额" show-overflow-tooltip prop="amount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.amount }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="入账比例" show-overflow-tooltip prop="ratio" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ (scope.row.ratio*100).toFixed(2)+'%' }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="入账日期" show-overflow-tooltip prop="date" align="center">
                </el-table-column>
                <el-table-column label="入账备注" show-overflow-tooltip prop="remark" align="center">
                </el-table-column>
              </el-table>
            </div>
            &lt;!&ndash;项目开票明细&ndash;&gt;
            <div class="slot" :style="{height: invoices.length>1?'200px':''}">
              <p class="titleName">项目开票明细</p>
              <el-table :data="invoices" height="100%" style="width: 100%;border-bottom: 1px solid rgba(163,186,239,0.2)" stripe @row-click="handleRowClick">
                <el-table-column label="序号" align="center" type="index">
                </el-table-column>
                <el-table-column label="开票日期" show-overflow-tooltip prop="invoiceDate" align="center">
                </el-table-column>
                <el-table-column label="票号" prop="invoiceNo" align="center">
                </el-table-column>
                <el-table-column label="无税金额" show-overflow-tooltip prop="taxFreeAmount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.taxFreeAmount }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="税额" show-overflow-tooltip prop="taxAmount" align="center">
                </el-table-column>
                <el-table-column label="税率" show-overflow-tooltip prop="taxRate" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ (scope.row.taxRate*100).toFixed(2)+'%' }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="含税金额" show-overflow-tooltip prop="amount" align="center">
                  <template slot-scope="scope">
                    <span class="bs">{{ scope.row.amount }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="开票备注" show-overflow-tooltip prop="invoiceRemark" align="center">
                </el-table-column>
              </el-table>
            </div>
            &lt;!&ndash;项目综合利润&ndash;&gt;
            <div class="slot">
              <p class="titleName">项目综合利润</p>
              <table class="horizontal-table">
                <tr>
                  <th style="width: 10%">综合售价</th>
                  <td style="width: 10%">{{ form1.comprehensivePrice }}</td>
                  <th style="width: 10%">综合成本</th>
                  <td style="width: 10%">{{ form1.comprehensiveCost }}</td>
                  <th style="width: 10%">利润率</th>
                  <td style="width: 10%">{{ (form1.profitMargin*100).toFixed(2)+'%' }}</td>
                  <th style="width: 10%">直接成本</th>
                  <td style="width: 10%">{{ form1.directCost }}</td>
                  <th style="width: 10%">其他成本</th>
                  <td style="width: 10%">{{ form1.otherCosts }}</td>
                </tr>
              </table>
            </div>
          </div>-->
          <div class="footerLine"></div>
          <div class="footerBut">
            <!--<div class="footerButItem" @click="getHide"><span>取消</span></div>-->
            <div class="footerButItem" @click="getConfirm"><span>关闭</span></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import gsap from 'gsap'
import bg from './bg/index.vue'
// import {
//   bankAccounts,
//   contractChange,
//   itemContract,
//   itemCostrecord,
//   itemExpense,
//   itemPayment,
//   itemReimbursements,
//   insurancecontract,
//   itemInvoices,
//   projectContracts
// } from '@/api/home.js'

export default {
  data() {
    return {
      show: false,
      showInner: false,
      tableDataList: [],
      obj: {},
      tableData: {},
      form1:{},//表单基础信息
      contract:[],//统计采购合同明细
      costrecord:[],//统计工程费用明细
      expense:[],//安装费用明细
      payment:[],//项目非合同报销明细
      reimbursements:[],//统计报销明细
      contractChange:[],//变更明细
      bankAccounts:[],//银行入账明细
      invoices:[],//开票明细
      insurancecontract:[],//统计保内采购合同明细

      personKpiDetail:{

      }
    }
  },
  components: {bg},
  mounted() {
    // this.getTableDataList()
    if (this.appendToBody) {
      const bodyElement = document.querySelector('body')
      bodyElement.appendChild(this.$el)
    }
  },
  props: {
    title: {
      type: String,
      default() {
        return '标题'
      }
    },
    width: {
      type: String,
      default() {
        return '85%'
      }
    },
    height: {
      type: String,
      default() {
        return '659px'
      }
    },
    // 弹窗层级,默认最大值
    zIndex: {
      type: Number,
      default: 147
    },
    // 是否将组件插入到body中 默认true
    appendToBody: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    handleRowClick(row, column, event) {
      this.obj = row
    },
    getTableDataList(item) {
      let obj = {
        itemNo:item.itemNo,
        shop:item.shop
      }
      projectContracts({
        projectNumber:item.itemNo,
        storeName:item.shop
      }).then(res => {
        if (res.code == 200) {
          this.form1 = this.replaceNullWithDash(res.data)
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      itemContract(obj).then(res => {
        if (res.code == 200) {
          this.contract = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      itemCostrecord(obj).then(res => {
        if (res.code == 200) {
          this.costrecord = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      itemExpense(obj).then(res => {
        if (res.code == 200) {
          this.expense = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      itemPayment(obj).then(res => {
        if (res.code == 200) {
          this.payment = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      itemReimbursements(obj).then(res => {
        if (res.code == 200) {
          this.reimbursements = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      insurancecontract(obj).then(res => {
        if (res.code == 200) {
          this.insurancecontract = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      contractChange(obj).then(res => {
        if (res.code == 200) {
          this.contractChange = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      bankAccounts(obj).then(res => {
        if (res.code == 200) {
          this.bankAccounts = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
      itemInvoices(obj).then(res => {
        if (res.code == 200) {
          this.invoices = res.data
        } else {
          this.$message({
            message: res.msg,
            type: 'error'
          })
        }
      }).catch(err => {
        console.log(err)
      })
    },
    getShow(item) {
      this.show = true
      this.personKpiDetail = item
      // this.getTableDataList(item)
      this.$nextTick(() => {
        gsap.to(this.$refs.popWinMain, {
          duration: 1,
          width: '1200px',
          onComplete: () => {
            this.showInner = true
          }
        })
      })
    },
    getConfirm() {
      this.getHide()
    },
    getHide() {
      this.showInner = false
      this.form1 = {}
      this.contract = []
      this.costrecord = []
      this.expense = []
      this.payment = []
      this.reimbursements = []
      this.contractChange = []
      this.bankAccounts = []
      this.invoices = []
      this.insurancecontract = []
      this.$nextTick(() => {
        gsap.to(this.$refs.popWinMain, {
          duration: 1,
          width: '0%',
          onComplete: () => {
            this.show = false
          }
        })
      })
      this.tableData = {}
    },
    replaceNullWithDash(obj) {
      for (let key in obj) {
        if (obj[key] === null) {
          obj[key] = '-'; // 将 null 替换为 '-'
        } else if (typeof obj[key] === 'object' && obj[key] !== null) {
          // 如果是对象或数组，递归处理
          this.replaceNullWithDash(obj[key]);
        }
      }
      return obj;
    },
    // 监听滚动事件
    handleScroll(event) {
      const container = event.target;
      const { scrollTop, scrollHeight, clientHeight } = container;

      // 检查是否滚动到底部（距离底部 100px 时触发）
      /*if (scrollHeight - (scrollTop + clientHeight) < 100 && !this.loading && this.hasMore) {
        this.loadData();
      }*/
    },
  }
}
</script>

<style lang="scss" scoped>
.popWinBg {
  position: fixed;
  z-index: 8;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: initial;
}

.popWin {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  align-content: flex-start;
  position: fixed;
  z-index: 10;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  pointer-events: none;

}

.popWinMain {
  pointer-events: initial;
  position: relative;
  overflow: hidden;
  width: 0;
  max-width: 1642px;
  height: 85%;
  max-height: 1004px;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  align-content: flex-start;
  //background: url("./bg/assets/bg.png") no-repeat;
  //background-size: 100% 100%;
  .popClose {
    position: absolute;
    right: 10px;
    top: 10px;
    background: url("./assets/icon_close.png") no-repeat;
    width: 16px;
    height: 16px;
    background-size: 100% 100%;
    cursor: pointer;
    z-index: 1;
    //transform: rotateX(180deg);
  }

  .popWinMainInner {
    margin-top: 40px;
    position: relative;
    width: calc(100% - 30px);
    height: calc(100% - 40px);
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: nowrap;
    flex-direction: column;
    align-content: flex-start;

    .tables {
      //background:#fff;
      height: 100%;
      width: 100%;
      overflow-y: auto;
      margin-bottom: 30px;
      .oneTable{
        border-bottom: 1px solid rgba(163,186,239,0.2)
      }
      .slot {
        position: relative;
        width: 100%;
        //height: calc(100% - 170px);
        margin-top: 0;
        overflow: auto;
        padding: 0 20px;
        box-sizing: border-box;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        flex-wrap: nowrap;
        flex-direction: column;
        align-content: flex-start;
        .titleName{
          margin: 24px auto 10px auto;
          color:#fff;
          font-size:20px;
        }
        /* 表格基本样式 */
        .horizontal-table {
          width: 100%; /* 表格宽度 */
          border-collapse: collapse; /* 合并边框 */
          margin: 0; /* 外边距 */
        }
        /* 表头样式 */
        .horizontal-table th {
          background-color: #053275; /* 背景色 */
          padding: 16px 10px; /* 内边距 */
          text-align: center; /* 文本对齐 */
          border: 1px solid rgba(163,186,239,0.2); /* 边框 */
          color: #eeaf0a;
          font-weight:600;
        }
        /* 单元格样式 */
        .horizontal-table td {
          padding: 16px 10px; /* 内边距 */
          background:#093b7d;
          text-align: left; /* 文本对齐 */
          border: 1px solid rgba(163,186,239,0.2); /* 边框 */
          color: #a3baef;
        }
        .noneBorder td, .noneBorder th{
          border: 1px solid rgba(163,186,239,0.2);
        }
        .tb50{
          width: 50%;
        }
        .tb25{
          width: 25%;
        }
        .tb12{
          width: 12.5%;
        }
      }
    }
    // 滚动条宽度
    .tables::-webkit-scrollbar {
      width: 6px;
    }
    // 滚动条轨道
    .tables::-webkit-scrollbar-track {
      background-color: rgba(2, 6, 23, 0.5);
    }
    // 小滑块
    .tables::-webkit-scrollbar-thumb {
      background: #56B5FF;
      border-radius: 3px;
    }
  }
}
.footerLine {
  background: url("./assets/footerLine.png") no-repeat;
  background-size: 100% 100%;
  height: 40px;
  width: 100%;
  position: relative;
  bottom: 0;
  margin-top: -30px;
}
.footerBut {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  align-content: flex-start;
  width: 100%;
  height: 100px;

  .footerButItem {
    background: url("./assets/butbg.png") no-repeat;
    background-size: 100% 100%;
    width: 130px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    align-content: flex-start;
    margin-left: 45px;
    margin-right: 45px;
    cursor: pointer;

    span {
      font-size: 18px;
      font-family: PingFang SC, PingFang SC;
      font-weight: 500;
      color: #89ADCE;
      letter-spacing: 20px;
      text-indent: 20px;
    }
  }

  .footerButItem:hover {
    background: url("./assets/butbgActive.png") no-repeat;
    background-size: 100% 100%;
    width: 130px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    align-content: flex-start;
    margin-left: 45px;
    margin-right: 45px;
    cursor: pointer;

    span {
      font-size: 18px;
      font-family: PingFang SC, PingFang SC;
      font-weight: 500;
      color: rgba(71, 200, 255, 1);
      letter-spacing: 20px;
      text-indent: 20px;
    }
  }
}
</style>
<style lang="scss">
.popWinMainInner {
  position: relative;
  height: 100%;
  width: 100%;

  .lx {
    width: 68px;
    //height: 26px;
    margin: auto;
    background: rgba(#47C8FF, 0.2);
    border-radius: 2px 2px 2px 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    align-content: flex-start;
    font-size: 14px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    color: #00FFFF;
  }

  .el-table__empty-text{
    color: #a3baef;
  }
  .el-table, .el-table__expanded-cell {
    background: none !important;
  }

  .el-table tr {
    background: #053275 !important;
  }

  .el-table td.el-table__cell div {
    color: rgba(184, 204, 255, 1) !important;
  }

  .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf {
    border: none !important;
  }

  .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
    background: #093b7d;

    .lx {
      width: 68px;
      //height: 26px;
      margin: auto;
      background: rgba(255, 184, 1, 0.2);
      border-radius: 2px 2px 2px 2px;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: nowrap;
      flex-direction: row;
      align-content: flex-start;
      font-size: 14px;
      font-family: PingFang SC, PingFang SC;
      font-weight: 500;
      color: rgba(255, 184, 1, 1);
    }
  }

  .el-table--enable-row-hover .el-table__body tr:hover > td {
    background: #0c4693 !important;
  }

  .el-table th.el-table__cell {
    background: #1455aa !important;
    color: rgba(71, 200, 255, 1);
  }

  .el-table--border::after, .el-table--group::after, .el-table::before {
    background-color: rgba(#EBEEF5, 0);
  }

  .el-table--border th.el-table__cell, .el-table__fixed-right-patch{
    border: none !important;
    border-bottom: 1px solid rgba(163,186,239,0.2) !important;
  }
  .el-table--border, .el-table--group{
    border: none !important;
  }
  .el-table--border th.el-table__cell.gutter:last-of-type{
    border: none !important;
  }

  .bs {
    font-size: 14px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    color: #FFB801;
  }

  //横向
  //横向horizontal
  .is-scrolling-left::-webkit-scrollbar {
    width: 100%;
    height: 10px;
  }
  //滚动条滑块
  .is-scrolling-left::-webkit-scrollbar-thumb {
    //滚动条里面小方块
    background: #56B5FF;
    border-radius: 5px;
  }
  //滚动条轨道
  .is-scrolling-left::-webkit-scrollbar-track-piece {
    background-color: rgba(2, 6, 23, 0);
  }
  //横向滚动右侧
  .is-scrolling-right::-webkit-scrollbar {
    width: 100%;
    height: 10px;
  }
  //滚动条滑块
  .is-scrolling-right::-webkit-scrollbar-thumb {
    //滚动条里面小方块
    background: #56B5FF;
    border-radius: 5px;
  }
  //滚动条轨道
  .is-scrolling-right::-webkit-scrollbar-track-piece {
    background-color: rgba(2, 6, 23, 0);
  }
  //横向滚动中部
  .is-scrolling-middle::-webkit-scrollbar {
    width: 100%;
    height: 10px;
  }
  //滚动条滑块
  .is-scrolling-middle::-webkit-scrollbar-thumb {
    //滚动条里面小方块
    background: #56B5FF;
    border-radius: 5px;
  }
  //滚动条轨道
  .is-scrolling-middle::-webkit-scrollbar-track-piece {
    background-color: rgba(2, 6, 23, 0);
  }
  //纵向滚动条
  .is-scrolling-none::-webkit-scrollbar {
    width: 0px;
    height: 200px;
  }
  //滚动条滑块
  .is-scrolling-none::-webkit-scrollbar-thumb {
    //滚动条里面小方块
    border-radius: 2px;
    box-shadow: inset 0 0 5px #189abc;
    background: #115091;
  }
  //滚动条轨道
  .is-scrolling-none::-webkit-scrollbar-track {
    //滚动条里面轨道
    box-shadow: inset 0 0 5px #1f4962;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0);
  }
}
</style>
